package com.zygh.lz.controller.app;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zygh.lz.controller.FileUpload;
import com.zygh.lz.dao.SectionMapper;
import com.zygh.lz.entity.Section;
import com.zygh.lz.entity.app.*;
import com.zygh.lz.entity.vo.AppTrailerInfoVO;
import com.zygh.lz.entity.vo.AppTrailerVO;
import com.zygh.lz.service.AppParkAreaService;
import com.zygh.lz.service.impl.AppParkService;
import com.zygh.lz.service.impl.AppTrailerAbnormalCauseService;
import com.zygh.lz.service.impl.AppTrailerInfoService;
import com.zygh.lz.stapprove.*;
import com.zygh.lz.util.DateUtils;
import com.zygh.lz.util.TreeUtil;
import com.zygh.lz.vo.ResultBeans;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Slf4j
@Api(tags = "App拖车信息管理模块", description = "AppTrailerInfoController")
@RestController
public class AppTrailerInfoController {
    @Resource
    private AppTrailerInfoService appTrailerInfoService;

    @Resource
    private AppTrailerAbnormalCauseService appTrailerAbnormalCauseService;

    @Resource
    private AppParkAreaService appParkAreaService;
    @Resource
    private AppParkService appParkService;
    @Resource
    private SectionMapper sectionMapper;
    @Value("${trailer.picture-path}")
    private String picturePath;

    private static final String TAG_NOT_PLATE = "无车牌";

    @ApiOperation("APP拖车信息上报")
    @RequestMapping(value = "/addTrailerInfo", method = RequestMethod.POST)
    @ViLog(logType = "2", module = "App拖车信息管理模块>拖车信息上报")
    public OutBean addTrailerInfo(@RequestBody(required = false) InBean inBean) {

        AppTrailerInfo appTrailerInfo = new AppTrailerInfo();
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);

        // 无车牌跳过重复提交检测
        if (!TAG_NOT_PLATE.equals(jsonObject.getString("vehiclePlate"))) {
            String startDate = DateUtil.offset(DateUtil.date(), DateField.HOUR_OF_DAY, -1).toString();
            String endDate = DateUtil.now();

            List<AppTrailerInfo> appTrailerInfos = appTrailerInfoService.list(Wrappers.<AppTrailerInfo>lambdaQuery()
                    .eq(AppTrailerInfo::getVehiclePlate, jsonObject.getString("vehiclePlate"))
                    .eq(AppTrailerInfo::getIsDel, 0)
                    .between(AppTrailerInfo::getCreatTime, startDate, endDate));
            if (appTrailerInfos.size() > 0) {
                return OutBeanUtil.resSuc(ResultUtil.resultBeansCodeError(508, "提交失败，近一小时有相同拖车记录:拖车民警："
                        + appTrailerInfos.get(0).getWarningSignal() + ",车牌号："
                        + appTrailerInfos.get(0).getVehiclePlate(), null), inBean);
            }
        }
        appTrailerInfo.setCode(IdUtil.simpleUUID());
        appTrailerInfo.setVehiclePlate(jsonObject.getString("vehiclePlate"));
        appTrailerInfo.setVehicleType(jsonObject.getString("vehicleType"));
        appTrailerInfo.setPhone(jsonObject.getString("phone"));
        appTrailerInfo.setIllegalAddress(jsonObject.getString("illegalAddress"));
        if (StringUtils.isNotEmpty(jsonObject.getString("parkCode"))) {
            appTrailerInfo.setParkCode(Integer.valueOf(jsonObject.getString("parkCode")));
        } else {
            return OutBeanUtil.resSuc(ResultUtil.resultBeansCodeError(508, "提交失败，停车场不存在", null), inBean);
        }
        appTrailerInfo.setWarningSignal(jsonObject.getString("warningSignal"));
        appTrailerInfo.setStaffName(jsonObject.getString("staffName"));
        appTrailerInfo.setSectionId(Integer.valueOf(jsonObject.getString("sectionId")));
        appTrailerInfo.setSectionName(jsonObject.getString("sectionName"));
        appTrailerInfo.setLongitude(jsonObject.getString("longitude"));
        appTrailerInfo.setLatitude(jsonObject.getString("latitude"));
        appTrailerInfo.setStatus(Integer.valueOf(jsonObject.getString("status")));
        appTrailerInfo.setParkPlace(jsonObject.getString("parkPlace"));
        appTrailerInfo.setIsElevated(jsonObject.getInteger("isElevated"));
        appTrailerInfo.setLicensePlate(jsonObject.getString("licensePlate"));
        appTrailerInfo.setCreatTime(new Date());

        // 设置同步状态为1 公安网数据不同步到互联网
        appTrailerInfo.setSignboard(1);
        AppPark appPark = appTrailerInfoService.getAppPark(appTrailerInfo.getParkCode());
        if (appPark == null) {
            return OutBeanUtil.resSuc(ResultUtil.resultBeansCodeError(508, "提交失败，停车场不存在,停车场编号：" + appTrailerInfo.getParkCode(), null), inBean);
        }

        //上传照片


        String imagePath = null;
        try {

            String picture = jsonObject.getString("picture");
            net.sf.json.JSONArray dataJson = net.sf.json.JSONArray.fromObject(picture);
            List<String> list = (List<String>) JSONArray.toCollection(dataJson, String.class);
            if (list.size() > 0) {
                for (String pictures : list) {
                    imagePath = FileUpload.uploadImage(pictures, picturePath);
                    //String s = MyUtil.compressionBase64(pictures, 0.4f);
                    AppPicture appPicture = new AppPicture();
                    appPicture.setCode(appTrailerInfo.getCode());
                    appPicture.setPicture(imagePath);
                    appPicture.setLongitude(appTrailerInfo.getLongitude());
                    appPicture.setLatitude(appTrailerInfo.getLatitude());
                    appPicture.setOrder(appTrailerInfo.getStatus());
                    appPicture.setCreatTime(new Date());
                    appTrailerInfoService.uploadTrailer(appPicture);

                }

            }
        } catch (IOException | IllegalArgumentException e) {
            e.printStackTrace();
            return OutBeanUtil.resSuc(ResultUtil.resultBeansCodeError(500, "提交失败,图片上传错误", null), inBean);
        }
//        // 民警提交不需要审核，直接为待补充状态
//        appTrailerInfo.setDriverState(1);


        //判断你主次干道
        appTrailerInfo.setTrafficType(1);
        Section section1 = sectionMapper.selectByPrimaryKey(appTrailerInfo.getSectionId());
        List<AppTraffic> appTrafficById = appTrailerInfoService.findAppTrafficById(section1.getSectionPid());
        TreeUtil.trailerType(appTrafficById, appTrailerInfo);

        ResultBeans resultBeans = appTrailerInfoService.addTrailerInfo(appTrailerInfo);
        //新增需发送短信的信息
        AppNote appNote = new AppNote();
        appNote.setCode(appTrailerInfo.getCode());
        appNote.setPlate(appTrailerInfo.getVehiclePlate());
        appNote.setPlace(appTrailerInfo.getIllegalAddress());
        appNote.setAddress(appTrailerInfo.getParkPlace() + "地址：" + appPark.getAddress());
        //咨询电话
        Section section = sectionMapper.selectByPrimaryKey(appTrailerInfo.getSectionId());
        String contactWay = appPark.getContactWay();
        if (contactWay == null){
            contactWay="无";
        }
        appNote.setContact(contactWay+"/"+section.getHotline());
        appNote.setPhone(appTrailerInfo.getPhone());
        appNote.setCreatTime(new Date());
        appNote.setStatus(0);
        appTrailerInfoService.insertNote(appNote);


        return OutBeanUtil.resSuc(resultBeans, inBean);
    }


    @ApiOperation("APP拖车信息修改")
    @PostMapping("updateTrailer")
    @ViLog(logType = "2", module = "App拖车信息管理模块>拖车信息修改")
    public OutBean updateTrailerInfo(@RequestBody(required = false) InBean inBean) {
        AppTrailerInfo appTrailerInfo = new AppTrailerInfo();
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        appTrailerInfo.setId(Integer.valueOf(jsonObject.getString("id")));
        String driverState = jsonObject.getString("driverState");
        String rejectReason = jsonObject.getString("rejectReason");

        appTrailerInfo.setRejectReason(rejectReason);
        appTrailerInfo.setDriverState(Integer.valueOf(driverState));

        //修改时候如果通过新增发送短信
        /*if ("2".equals(driverState)) {
            AppTrailerInfo code = appTrailerInfoService.getById(appTrailerInfo.getId());

            //新增需发送短信的信息
            AppNote appNote = new AppNote();
            appNote.setCode(code.getCode());
            appNote.setPlate(code.getVehiclePlate());
            appNote.setPlace(code.getIllegalAddress());
            appNote.setAddress(code.getParkPlace());

            //咨询电话
            Section section = sectionMapper.selectByPrimaryKey(code.getSectionId());
            appNote.setContact(section.getHotline());
            appNote.setPhone(code.getPhone());
            appNote.setCreatTime(new Date());
            appNote.setStatus(0);
            appTrailerInfoService.insertNote(appNote);
        }*/

        if (appTrailerInfo.getDriverState() == 3 || appTrailerInfo.getDriverState() == 4) {
            if (org.apache.commons.lang3.StringUtils.isEmpty(appTrailerInfo.getRejectReason()) || appTrailerInfo.getRejectReason().length() < 2 || appTrailerInfo.getRejectReason().length() > 100) {
                return OutBeanUtil.resErr("请输入拒绝原因，2-100字", inBean);
            }
        }
        ResultBeans resultBeans = appTrailerInfoService.updateTrailerInfo(appTrailerInfo);

        return OutBeanUtil.resSuc(resultBeans, inBean);
    }


    @ApiOperation("APP拖车信息查询")
    @PostMapping("findTrailerInfo")
    @ViLog(logType = "2", module = "App拖车信息管理模块>拖车信息查询")
    public OutBean findTrailerInfo(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        String warningSignal = jsonObject.getString("warningSignal");
        Integer status = null;
        if (StringUtils.isNotEmpty(jsonObject.getString("status"))) {
            status = Integer.valueOf(jsonObject.getString("status"));
        }
        String vehiclePlate = jsonObject.getString("vehiclePlate");
        //时间条件 2022-08-23
        String day = jsonObject.getString("day");

        String startTime = jsonObject.getString("startTime");
        String endTime = jsonObject.getString("endTime");
        //停车场
        Integer code = null;
        if (StringUtils.isNotEmpty(jsonObject.getString("code"))) {
            code = Integer.valueOf(jsonObject.getString("code"));
        }
        //审批状态
        Integer driverState = null;
        if (StringUtils.isNotEmpty(jsonObject.getString("driverState"))) {
            driverState = Integer.valueOf(jsonObject.getString("driverState"));
        }


        int current = Integer.valueOf(jsonObject.getString("current"));
        int size = Integer.valueOf(jsonObject.getString("size"));
        ResultBeans resultBeans = appTrailerInfoService.findTrailerInfo(warningSignal, vehiclePlate, status, code,
                startTime, endTime, driverState, current, size);
        return OutBeanUtil.resSuc(resultBeans, inBean);
    }


    @ApiOperation("APP拖车图片上传")
    @PostMapping("uploadTrailer")
    @ViLog(logType = "2", module = "App拖车信息管理模块>app拖车图片上传")
    public OutBean uploadTrailer(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        String problemPicture = jsonObject.getString("picture");
        net.sf.json.JSONArray dataJson = net.sf.json.JSONArray.fromObject(problemPicture);
        List<String> list = (List<String>) JSONArray.toCollection(dataJson, String.class);

        String code = jsonObject.getString("code");
        Integer order = Integer.valueOf(jsonObject.getString("order"));
        String longitude = jsonObject.getString("longitude");
        String latitude = jsonObject.getString("latitude");
        if (StringUtils.isEmpty(longitude)) {
            AppTrailerInfo one = appTrailerInfoService.getOne(Wrappers.<AppTrailerInfo>lambdaQuery().eq(AppTrailerInfo::getCode, code).last("LIMIT 1"));
            AppParkArea appParkArea = appParkAreaService.getOne(Wrappers.<AppParkArea>lambdaQuery().eq(AppParkArea::getParkCode, one.getParkCode()).last("LIMIT 1"));
            if (appParkArea != null) {
                longitude = appParkArea.getLongitude();
                latitude = appParkArea.getLatitude();
            }
        }
        AppPicture appPicture = new AppPicture();
        appPicture.setLatitude(latitude);
        appPicture.setLongitude(longitude);
        appPicture.setCode(code);
        appPicture.setPicture(list.get(0));
        appPicture.setOrder(order);
        appPicture.setCreatTime(new Date());

        String imagePath = null;
        try {

            imagePath = FileUpload.uploadImage(appPicture.getPicture(), picturePath);
            appPicture.setPicture(imagePath);
        } catch (IOException | IllegalArgumentException e) {
            e.printStackTrace();
            return OutBeanUtil.resSuc(ResultUtil.resultBeansCodeError(500, "提交失败,图片上传错误", null), inBean);
        }
        //查询照片库内有无该现场照片，如果有则覆盖
        ResultBeans resultBeans = appTrailerInfoService.uploadTrailer(appPicture);

        appTrailerAbnormalCauseService.remove(Wrappers.<AppTrailerAbnormalCause>lambdaQuery().eq(AppTrailerAbnormalCause::getCode, code));

        //修改拖车信息状态
        AppTrailerInfo one = appTrailerInfoService.getOne(Wrappers.<AppTrailerInfo>lambdaQuery()
                .eq(AppTrailerInfo::getCode, code));
        one.setStatus(order);
        one.setDriverState(2);
        one.setIsCheckAbnormal(0);
        one.setSignboard(0);
        appTrailerInfoService.updateById(one);
        return OutBeanUtil.resSuc(resultBeans, inBean);
    }

    @ApiOperation("拖车信息检测")
    @PostMapping("pictureCheck")
    @ViLog(logType = "2", module = "App拖车信息管理模块>拖车信息检测")
    public OutBean pictureCheck(@RequestBody(required = false) InBean inBean) {
        AppTrailerInfo appTrailerInfo = new AppTrailerInfo();
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        // 从省厅入参获取车牌号数据
        appTrailerInfo.setVehiclePlate(jsonObject.getString("vehiclePlate"));
        // 从省厅入参获取违停地址
        appTrailerInfo.setIllegalAddress(jsonObject.getString("illegalAddress"));
        List<String> messages = new ArrayList<>();
        if (!TAG_NOT_PLATE.equals(appTrailerInfo.getVehiclePlate())) {
            int monthCount = appTrailerInfoService.count(Wrappers.<AppTrailerInfo>lambdaQuery()
                    .eq(AppTrailerInfo::getVehiclePlate, appTrailerInfo.getVehiclePlate())
                    .eq(AppTrailerInfo::getIsDel, 0)
                    .between(AppTrailerInfo::getCreatTime, DateUtils.getTimesMonthmorning(), DateUtils.getTimesMonthnight()));
            int dayCount = appTrailerInfoService.count(Wrappers.<AppTrailerInfo>lambdaQuery()
                    .eq(AppTrailerInfo::getVehiclePlate, appTrailerInfo.getVehiclePlate())
                    .eq(AppTrailerInfo::getIsDel, 0)
                    .between(AppTrailerInfo::getCreatTime, DateUtils.getDayBegin(), DateUtils.getDayEnd()));
            if (monthCount >= 4) {
                messages.add("该车辆当月上传次数已达到5次");
            }
            if (dayCount >= 1) {
                messages.add("该车辆当日上传次数已达到2次");
            }
        }
        String problemPicture = jsonObject.getString("picture");
        net.sf.json.JSONArray dataJson = net.sf.json.JSONArray.fromObject(problemPicture);
        List<String> list = (List<String>) JSONArray.toCollection(dataJson, String.class);
        JSONObject object = appTrailerInfoService.pictureCheck(list.get(0));
        if (object.getInteger("isExist") > 0) {
            messages.add("照片与历史拖车照片相似度过高");
        }
//        String plateNoPark = appTrailerInfoService.identifyTheLicensePlateNo(list.get(0));
//        if ("无法识别".equals(plateNoPark)) {
//            messages.add("照片清晰度不足，车牌无法识别");
//        }
        if (messages.size() > 0) {
            return OutBeanUtil.resSuc(ResultUtil.resultBeansCodeError(208, "检测到异常", messages), inBean);
        }
        return OutBeanUtil.resSuc(ResultUtil.resultBeansSuccess("success"), inBean);
    }

    @ApiOperation("停车场照片检测")
    @PostMapping("pictureParkCheck")
    @ViLog(logType = "2", module = "App拖车信息管理模块>停车场照片检测")
    public OutBean pictureParkCheck(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        List<String> messages = new ArrayList<>();
        String problemPicture = jsonObject.getString("picture");
        net.sf.json.JSONArray dataJson = net.sf.json.JSONArray.fromObject(problemPicture);
        List<String> list = (List<String>) JSONArray.toCollection(dataJson, String.class);
        String code = jsonObject.getString("code");
//        Integer order = Integer.valueOf(jsonObject.getString("order"));
        JSONObject object = appTrailerInfoService.pictureCheck(list.get(0));
        if (object.getInteger("isExist") > 0) {
            messages.add("照片与历史拖车照片相似度过高");
        }
//        String plateNoPark = appTrailerInfoService.identifyTheLicensePlateNo(list.get(0));
//        StringBuilder plateNoTemp = new StringBuilder();
//        if ("无法识别".equals(plateNoPark)) {
//            messages.add("照片清晰度不足，车牌无法识别");
//        }
//        plateNoTemp.append("'").append(plateNoPark).append("'");
//        AppPicture picture = appTrailerInfoService.getPicture(code, 0);
//        String plateNo = appTrailerInfoService.identifyTheLicensePlateNo(picture.getPicture());
//        plateNoTemp.append("'").append(plateNo).append("'");
//        if (plateNo.substring(2).equals(plateNoPark.substring(2))) {
//            messages.add("两张照片车牌号不一致:" + plateNoTemp);
//        }
        if (messages.size() > 0) {
            return OutBeanUtil.resSuc(ResultUtil.resultBeansCodeError(208, "检测到异常", messages), inBean);
        }
        return OutBeanUtil.resSuc(ResultUtil.resultBeansSuccess("success"), inBean);
    }

    @ApiOperation("根据id查询拖车信息详情")
    @PostMapping("findTrailierInfoById")
    @ViLog(logType = "2", module = "App拖车信息管理模块>根据id查询拖车信息详情")
    public OutBean findTrailierInfoById(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        Integer id = Integer.valueOf(jsonObject.getString("id"));
        ResultBeans trailierInfoById = appTrailerInfoService.findTrailierInfoById(id);
        return OutBeanUtil.resSuc(trailierInfoById, inBean);
    }

    @ApiOperation("车辆类型列表查询")
    @PostMapping("findAppPlateAll")
    @ViLog(logType = "2", module = "App拖车信息管理模块>车辆类型列表查询")
    public OutBean findAppPlateAll(@RequestBody(required = false) InBean inBean) {
        ResultBeans appPlateAll = appTrailerInfoService.findAppPlateAll();
        return OutBeanUtil.resSuc(appPlateAll, inBean);
    }


    @ApiOperation("停车场信息列表返回")
    @PostMapping("findAppParkAll")
    @ViLog(logType = "2", module = "App拖车信息管理模块>车辆类型列表查询")
    public OutBean findAppParkAll(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        //子级部门id
        Integer id = Integer.valueOf(jsonObject.getString("sysSectionId"));
        Section section = sectionMapper.selectByPrimaryKey(id);
        if (section.getSectionPid() != 74) {
            id = section.getSectionPid();
        }
//        ResultBeans appPlateAll = appTrailerInfoService.findAppParkAll(id);
        ResultBeans appPlateAll = appTrailerInfoService.findAppParkAll(id);
        return OutBeanUtil.resSuc(appPlateAll, inBean);
    }

    @ApiOperation("拖车首页统计数据获取")
    @PostMapping("trailerHomeStats")
    @ViLog(logType = "2", module = "App拖车信息管理模块>拖车首页统计数据获取")
    public OutBean trailerHomeStats(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        //子级部门id
        String policeNumber = jsonObject.getString("policeNumber");
        Date date = DateUtil.parse(jsonObject.getString("date") + "-01");


        Date startTimeOfCurrentMonth = DateUtils.getStartTimeOfCurrentMonth(date);
        Date endTimeOfCurrentMonth = DateUtils.getEndTimeOfCurrentMonth(date);
        ResultBeans trailerStats = appTrailerInfoService.trailerStats(policeNumber, startTimeOfCurrentMonth, endTimeOfCurrentMonth);
        return OutBeanUtil.resSuc(trailerStats, inBean);
    }

    @ApiOperation("本人拖车记录统计")
    @PostMapping("trailerInfoStats")
    @ViLog(logType = "2", module = "App拖车信息管理模块>拖车数据统计")
    public OutBean trailerInfoStats(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        //子级部门id
        String policeNumber = jsonObject.getString("policeNumber");

        ResultBeans trailerStats = appTrailerInfoService.trailerInfoStats(policeNumber);
        return OutBeanUtil.resSuc(trailerStats, inBean);
    }

    @ApiOperation("本人支队停车场记录统计")
    @PostMapping("parkStats")
    @ViLog(logType = "2", module = "App拖车信息管理模块>停车场备案记录统计")
    public OutBean parkStats(@RequestBody(required = false) InBean inBean) {
        JSONObject jsonObject = inBean.convertObj(JSONObject.class);
        //子级部门id
        String policeNumber = jsonObject.getString("policeNumber");

        ResultBeans trailerStats = appTrailerInfoService.parkStats(policeNumber);
        return OutBeanUtil.resSuc(trailerStats, inBean);
    }

    @ApiOperation("需发送短信的拖车信息(视频网122使用)")
    @GetMapping("findAppNote")
    public List<AppNote> findAppNote() {
        return appTrailerInfoService.findAppNote();
    }

    @ApiOperation("修改短信状态(视频网122使用)")
    @PostMapping("updateAppNote")
    public int updateAppNote(@RequestBody AppNote appNote) {
        int i = appTrailerInfoService.updateAppNote(appNote);
        //同时修改拖车信息状态
        AppTrailerInfo code = appTrailerInfoService.getOne(new QueryWrapper<AppTrailerInfo>()
                .eq("code", appNote.getCode()));
        if (code == null) {
            return 0;
        }
        code.setSmsStatus(appNote.getStatus());
        if (appNote.getStatus() == 1) {
            code.setNoticeTime(DateUtil.date());
        }
        appTrailerInfoService.updateById(code);
        return i;
    }


    @ApiOperation("根据标识查询民警拖车记录列表(互联网使用)")
    @GetMapping("findTrailerByBoard")
    public List<AppTrailerInfoVO> findTrailerByBoard() {
        return appTrailerInfoService.findTrailerByBoard();
    }

    @ApiOperation("根据标识所有未同步的状态数据(互联网使用)")
    @GetMapping("findNoSync")
    public List<AppTrailerVO> findNoSync() {
        return appTrailerInfoService.findNoSync();
    }


    @ApiOperation("修改拖车记录同步标识(互联网使用)")
    @GetMapping("updateTrailerByBoard")
    public Boolean updateTrailerByBoard(int id) {
        AppTrailerInfo byId = appTrailerInfoService.getById(id);
        if (byId != null) {
            byId.setSignboard(1);
            return appTrailerInfoService.updateById(byId);
        }
        return false;
    }

}
